CC = gcc
CFLAGS = -Wall -O2
LDFLAGS = -lm

objects = huffman.o bf.o

all : compress decompress rapport.dvi

compress : compress.c $(objects)
	$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)

decompress : decompress.c $(objects)
	$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)

%.o : %.c %.h
	$(CC) -c $(CFLAGS) $< -o $@

rapport.dvi : rapport.tex
	latex rapport

.PHONY : clean
clean :
	-rm $(objects) compress decompress
